/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'

const maintenanceRouter = {
  path: '/maintenance',
  component: Layout,
  redirect: '/maintenance/account/user',
  name: 'Maintenance',
  meta: {
    title: 'maintenanceControl',
    icon: 'maintenance',
    roles: ['admin']
  },
  children: [
    {
      path: 'account',
      component: () => import('@/views/maintenance/account/index'), // Parent router-view
      name: 'Account',
      meta: { title: 'accountControl', icon: 'peoples' },
      redirect: '/maintenance/account/user',
      children: [
        {
          path: 'user',
          component: () => import('@/views/maintenance/account/user'),
          name: 'userControl',
          meta: { title: 'userControl' }
        },
        {
          path: 'role',
          component: () => import('@/views/maintenance/account/role'),
          name: 'rolesControl',
          meta: { title: 'rolesControl' }
        },
        {
          path: 'source',
          component: () => import('@/views/maintenance/account/source'),
          name: 'sourceControl',
          meta: { title: 'sourceControl' }
        }
      ]
    },
    {
      path: 'device',
      name: 'deviceControl',
      component: () => import('@/views/maintenance/device/index'),
      name: 'Device',
      meta: { title: 'deviceControl', icon: 'device' },
      redirect: '/maintenance/device/handheld',
      children: [
        {
          path: 'handheld',
          component: () => import('@/views/maintenance/device/handheld'),
          name: 'handheld',
          meta: { title: 'handheld' }
        },
        {
          path: 'position',
          component: () => import('@/views/maintenance/device/position'),
          name: 'position',
          meta: { title: 'position' }
        },
        {
          path: 'onboard',
          component: () => import('@/views/maintenance/device/onboard'),
          name: 'onboard',
          meta: { title: 'onboard' }
        }
      ]
    },
    {
      path: 'group',
      name: 'group',
      component: () => import('@/views/maintenance/group/index'),
      meta: { title: 'groupControl', icon: 'group' }
    },
    {
      path: 'remote',
      name: 'remote',
      component: () => import('@/views/maintenance/group/index'),
      meta: { title: 'remote', icon: 'remote' }
    },
    {
      path: 'log',
      name: 'log',
      component: () => import('@/views/maintenance/log/index'),
      meta: { title: 'log', icon: 'log' }
    },
    {
      path: 'version',
      name: 'version',
      component: () => import('@/views/maintenance/version/index'),
      meta: { title: 'version', icon: 'version' }
    }
  ]
}

export default maintenanceRouter
